<template>
  <div class="java_item_wrap">
    <el-form
      :model="commonG6FromObj"
      ref="ruleForm"
      label-width="110px"
      class="demo-ruleForm"
    >
      <el-form-item label="名称" prop="name">
        <el-input v-model="commonG6FromObj.name"></el-input>
      </el-form-item>
      <el-form-item label="JAVA类型" prop="type">
        <el-select v-model="commonG6FromObj.type" placeholder="请选择JAVA类型">
          <el-option label="自执行脚本" value="自执行脚本"></el-option>
          <el-option label="手动执行" value="手动执行"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="脚本内容" prop="desc">
        <el-input
          type="textarea"
          v-model="commonG6FromObj.jiaobenContent"
        ></el-input>
      </el-form-item>
      <el-form-item label="执行路径" prop="flieURL">
        <input type="file" ref="file" id="file" @change="upload" hidden />
        <el-input placeholder="请输入内容" v-model="commonG6FromObj.flieURL">
          <el-button
            slot="append"
            icon="el-icon-more"
            type="success"
            @click="btnChange"
          ></el-button>
        </el-input>
      </el-form-item>
      <el-form-item label="备注" prop="beizhu">
        <el-input type="textarea" v-model="commonG6FromObj.beizhu"></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  props: {
    commonG6FromObj: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {};
  },
  methods: {
    btnChange() {
      this.$refs.file.click();
    },
    upload() {
      this.commonG6FromObj.flieURL = this.$refs.file.value;
    },
  },
};
</script>
<style scoped lang="scss"></style>
